.class public Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;
.super Landroid/widget/RelativeLayout;
.source "DownloadItem.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem$DownloadSelectListener;
    }
.end annotation


# static fields
.field private static CHECKMARK_AREA:F


# instance fields
.field private mCheckBox:Landroid/widget/CheckBox;

.field private mDownloadId:J

.field private mIsInDownEvent:Z

.field private mListener:Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem$DownloadSelectListener;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 34
    const/high16 v0, -0x40800000

    sput v0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->CHECKMARK_AREA:F

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .registers 3
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 57
    invoke-direct {p0, p1}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V

    .line 36
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mIsInDownEvent:Z

    .line 58
    invoke-direct {p0}, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->initialize()V

    .line 59
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .registers 4
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;

    .prologue
    .line 52
    invoke-direct {p0, p1, p2}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 36
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mIsInDownEvent:Z

    .line 53
    invoke-direct {p0}, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->initialize()V

    .line 54
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .registers 5
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;
    .param p3, "defStyle"    # I

    .prologue
    .line 47
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 36
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mIsInDownEvent:Z

    .line 48
    invoke-direct {p0}, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->initialize()V

    .line 49
    return-void
.end method

.method private initialize()V
    .registers 3

    .prologue
    .line 62
    sget v0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->CHECKMARK_AREA:F

    const/high16 v1, -0x40800000

    cmpl-float v0, v0, v1

    if-nez v0, :cond_15

    .line 63
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    sget v1, Lcom/zuimeia_sdk_download/downloadprovider/R$dimen;->zuimeia_sdk_download_checkmark_area:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v0

    int-to-float v0, v0

    sput v0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->CHECKMARK_AREA:F

    .line 65
    :cond_15
    return-void
.end method

.method private toggleCheckMark()V
    .registers 5

    .prologue
    .line 115
    iget-object v0, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mCheckBox:Landroid/widget/CheckBox;

    invoke-virtual {v0}, Landroid/widget/CheckBox;->toggle()V

    .line 116
    iget-object v0, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mListener:Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem$DownloadSelectListener;

    iget-wide v2, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mDownloadId:J

    iget-object v1, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mCheckBox:Landroid/widget/CheckBox;

    invoke-virtual {v1}, Landroid/widget/CheckBox;->isChecked()Z

    move-result v1

    invoke-interface {v0, v2, v3, v1}, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem$DownloadSelectListener;->onDownloadSelectionChanged(JZ)V

    .line 117
    return-void
.end method


# virtual methods
.method protected onFinishInflate()V
    .registers 2

    .prologue
    .line 69
    invoke-super {p0}, Landroid/widget/RelativeLayout;->onFinishInflate()V

    .line 70
    sget v0, Lcom/zuimeia_sdk_download/downloadprovider/R$id;->download_checkbox:I

    invoke-virtual {p0, v0}, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/CheckBox;

    iput-object v0, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mCheckBox:Landroid/widget/CheckBox;

    .line 71
    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .registers 6
    .param p1, "event"    # Landroid/view/MotionEvent;

    .prologue
    const/4 v3, 0x0

    .line 83
    const/4 v0, 0x0

    .line 84
    .local v0, "handled":Z
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v1

    packed-switch v1, :pswitch_data_3c

    .line 105
    :cond_9
    :goto_9
    :pswitch_9
    if-eqz v0, :cond_36

    .line 106
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->postInvalidate()V

    .line 111
    :goto_e
    return v0

    .line 86
    :pswitch_f
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v1

    sget v2, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->CHECKMARK_AREA:F

    cmpg-float v1, v1, v2

    if-gez v1, :cond_9

    .line 87
    const/4 v1, 0x1

    iput-boolean v1, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mIsInDownEvent:Z

    .line 88
    const/4 v0, 0x1

    goto :goto_9

    .line 93
    :pswitch_1e
    iput-boolean v3, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mIsInDownEvent:Z

    goto :goto_9

    .line 97
    :pswitch_21
    iget-boolean v1, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mIsInDownEvent:Z

    if-eqz v1, :cond_33

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v1

    sget v2, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->CHECKMARK_AREA:F

    cmpg-float v1, v1, v2

    if-gez v1, :cond_33

    .line 98
    invoke-direct {p0}, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->toggleCheckMark()V

    .line 99
    const/4 v0, 0x1

    .line 101
    :cond_33
    iput-boolean v3, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mIsInDownEvent:Z

    goto :goto_9

    .line 108
    :cond_36
    invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->onTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    goto :goto_e

    .line 84
    nop

    :pswitch_data_3c
    .packed-switch 0x0
        :pswitch_f
        :pswitch_21
        :pswitch_9
        :pswitch_1e
    .end packed-switch
.end method

.method public setDownloadId(J)V
    .registers 4
    .param p1, "downloadId"    # J

    .prologue
    .line 74
    iput-wide p1, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mDownloadId:J

    .line 75
    return-void
.end method

.method public setSelectListener(Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem$DownloadSelectListener;)V
    .registers 2
    .param p1, "listener"    # Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem$DownloadSelectListener;

    .prologue
    .line 78
    iput-object p1, p0, Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem;->mListener:Lcom/zuimeia/sdk/download/providers/downloads/ui/DownloadItem$DownloadSelectListener;

    .line 79
    return-void
.end method
